package com.chinasoft.mall.model;

import java.io.Serializable;
import java.util.HashMap;

public class PageBean{
	// 数据总数
	private int total = 0;
	// 每页个数
	private int page_number = 10;
	// 当前页
	private int cur_page = 0;
	// 总页数
	private int number_page = 0;
	//获取数据总数
	private int own_number=0;

	public void setOwn_number(int own_number) {
		this.own_number = own_number;
	}

	public PageBean(int page_number,int total) {
		this.total = total;
		this.page_number = page_number;
		number_page=total / page_number + (total % page_number == 0 ? 0:1);
	}
	
	public boolean isNextPage(){
		if(own_number<total){
			return true;
		}else{
			return false;
		}
	}
	public void nextPage(HashMap<String, String> reqData){
		if(cur_page>=number_page){
			cur_page=number_page;
			return;
		}
		reqData.put("pageNo",(++cur_page)+"");
		reqData.put("pageSize", page_number+"");
	}
}
